/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.hl7.datatypes.r2.foundation;

import java.util.Collection;
import org.hl7.datatypes.r2.flavors.st.ST_SIMPLE;
import org.hl7.datatypes.r2.quantities.INT;

/**
 *
 * @author Obama
 */
public class BAG<T> extends COLL<T> {

    public BAG(Collection<T> values) {
        super(values);
    }

    public BAG() {
    }

    public INT count(T item) {
        int i=0;
        Collection<T> coll=getCollValue();
        for(T t:coll){
            if(t!=null&&t.equals(item)||(t==null&&item==null)){
                i++;
            }
        }
        return new INT(i);
    }

    public BAG<T> plus(BAG<T> x) {
        return null;
    }

    public BAG<T> minus(BAG<T> x) {
        return null;
    }

    public ST_SIMPLE literal() {
        return null;
    }

    public BAG<T> promotion(T x) {
        return null;
    }

    public BAG<T> promotion(DSET<T> x) {
        return null;
    }
}
